package org.skycastle.megastructure

import com.jme.app.AbstractGame
import com.jme.system.DisplaySystem
import java.net.URL
import space.TerrainSpace
import utils.ResourceLoader

/**
 *
 *
 * @author Hans Haggstrom
 */

object Megastructure {


  def main(args: Array[String]) {

    println("Megastructure Activated")

    val logoUrl = ResourceLoader.getResourceURL( "images/megastructure-logo.png" )

    val player = createPlayer
    val universe = createUniverse( player )

    val renderer = new MainGameLoop( "Megastructure", universe, player )
    renderer.setConfigShowMode(  AbstractGame.ConfigShowMode.ShowIfNoConfig, logoUrl   )

    renderer.start();

  }

  def createPlayer : Character = {

    val player = new Character()

    player

  }


  def createUniverse( player : Character ) : Universe = {

    val universe = new Universe()

    val planet: TerrainSpace = new TerrainSpace()
    universe.addSpace( planet )

    planet.addEntity( player )


    universe

  }


}